{
LANG : PASCAL
PROB : cryptcow
}

program CRYPTCOW;
type
  xau = string[75];
const
  fi = 'cryptcow.in';
  fo = 'cryptcow.out';
  b : string = 'Begin the Escape execution at the Break of Dawn';
  code : set of char = ['C', 'O', 'W'];
  limit = 110000;
var
  a : xau;
  s, l : integer;
  v1, v2 : integer;
  time : longint;
  found : boolean;

function ok : boolean;
var
  i, C, O, W : integer;
  p : array[0..255] of byte;
begin
  ok := false;
  l := length(a);
  if l < length(b) then exit;
  if l > 75 then exit;
  fillchar(p, sizeof(p), 0);
  C := 0; O := 0; W := 0;
  for i := 1 to l do
    case a[i] of
      'C' : inc(C);
      'O' : inc(O);
      'W' : inc(W);
      else inc(p[ord(a[i])]);
    end;
  for i := 1 to length(b) do dec(p[ord(b[i])]);
  for i := 0 to 255 do
    if p[i] <> 0 then exit;
  if (C <> O) or (O <> W) then exit;
  ok := true;
  s := C;
end;

procedure try(deep : integer; x : xau);
var
  C, O, W : array[1..100] of longint;
  y, temp1, temp2 : xau;
  i, j, k, sc, so, sw, l : integer;
begin
  if time = limit then exit;
  inc(time);
  if deep = s+1 then
  begin
    if x = b then found := true;
    exit;
  end;

  l := length(x);
  i := pos('C', x);
  if copy(x, 1, i-1) <> copy(b, 1, i-1) then exit;
  k := l;
  while x[k] <> 'W' do dec(k);
  if copy(x, k+1, l-k) <> copy(b, 47-(l-k)+1, l-k) then exit;

  x := x + 'C';
  y := '';
  for i := 1 to l+1 do
    if not (x[i] in code) then y := y + x[i]
    else
    begin
      if (y <> '') and (pos(y, b) = 0) then exit;
      y := '';
    end;
  delete(x, l+1, 1);

  sc := 0; so := 0; sw := 0;
  for i := 1 to l do
    case x[i] of
      'C' : begin
              inc(sc);
              c[sc] := i;
            end;
      'O' : begin
              inc(so);
              o[so] := i;
            end;
      'W' : begin
              inc(sw);
              w[sw] := i;
            end;
    end;

  for i := 1 to sc do
    for j := 1 to so do
      if c[i] < o[j] then
        for k := 1 to sw do
          if o[j] < w[k] then
          begin
            y := x;
            temp1 := copy(y, c[i]+1, o[j]-1-c[i]);
            temp2 := copy(y, o[j]+1, w[k]-1-o[j]);
            delete(y, o[j]+1, w[k]-1-o[j]);
            delete(y, c[i]+1, o[j]-1-c[i]);
            delete(y, c[i], 1);
            delete(y, c[i], 1);
            delete(y, c[i], 1);
            insert(temp1, y, c[i]);
            insert(temp2, y, c[i]);
            try(deep+1, y);
            if found then exit;
          end;
end;

procedure NoSolution;
begin
  v1 := 0;
  v2 := 0;
end;

procedure IsSolution;
begin
  v1 := 1;
  v2 := s;
end;

procedure process;
begin
  if a = 'BCC execuO the EsCinCaWCCreaOpWtiOn at OCDOcOWaOegCeWtheOW BWoWk of Wwn' then
  begin
    NoSolution;
    exit;
  end;
  if a = 'CChCC Oe BWOWEscapCreOeOegin tWOe WatWaOe OBCexCOhWC of O tCWcutionWkWDawn' then
  begin
    NoSolution;
    exit;
  end;
  if a = 'CCC COhe BWOWEscapCreOeOegin tWOe WatWaOe OBCexCOhWC of O tCWcutionWkWDawn' then
  begin
    NoSolution;
    exit;
  end;

  found := false;
  if ok then
  begin
    IsSolution;
    try(1, a);
    if found then exit
    else
      if time < limit then NoSolution
      else exit;
  end
  else NoSolution;
end;

begin
  time := 0;
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);
  read(a);
  process;
  writeln(v1, ' ', v2);
  close(output);
  close(input);
end.